/// Replicating Table 5
clear 
import delimited "03-Silencing-Study/data/01-clean-data/clean_data.csv"
//main effect
xi: reg puresilencing female male noname i.experiment1, r 
di e(r2_a)
//Study 1 only
xi: reg puresilencing female male noname if experiment1 == 1, r 
di e(r2_a)
//Study 2 only
xi: reg puresilencing female male noname if experiment1 == 0, r 
di e(r2_a)

///By gender
///subset to women only
xi: reg puresilencing female male noname i.experiment1 if gender=="female", r
di e(r2_a)
///subset to men only
xi: reg puresilencing female male noname i.experiment1 if gender=="male", r 
di e(r2_a)

///cluster SEs
//main effect
xi: reg puresilencing female male noname i.experiment1, r cluster(texterid)
di e(r2_a)
//Study 1 only
xi: reg puresilencing female male noname if experiment1 == 1, r cluster(texterid)
di e(r2_a)
//Study 2 only
xi: reg puresilencing female male noname if experiment1 == 0, r cluster(texterid)
di e(r2_a)

///By gender
///subset to women only
xi: reg puresilencing female male noname i.experiment1 if gender=="female", r 
di e(r2_a)
///subset to men only
xi: reg puresilencing female male noname i.experiment1 if gender=="male", r 
di e(r2_a)

///By texter gender
///subset to women only
xi: reg puresilencing female male noname i.experiment1 if textergender=="Woman", r 
di e(r2_a)
///subset to men only
xi: reg puresilencing female male noname i.experiment1 if textergender=="Man", r 
di e(r2_a)

/// Replicating Table S9
//main effect
xi: ivreg puresilencing i.experiment1 (femaleinstrument maleinstrument nonameinstrument = female male noname), r 
di e(r2_a)
//Study 1
xi: ivreg puresilencing (femaleinstrument maleinstrument nonameinstrument = female male noname) if experiment1 == 1, r 
di e(r2_a)
//Study 2
xi: ivreg puresilencing (femaleinstrument maleinstrument nonameinstrument = female male noname) if experiment1 == 0, r 
di e(r2_a)

///By gender
///subset to women only
xi: ivreg puresilencing i.experiment1 (femaleinstrument maleinstrument nonameinstrument = female male noname) if gender=="female", r 
di e(r2_a)
///subset to men only
xi: ivreg puresilencing i.experiment1 (femaleinstrument maleinstrument nonameinstrument = female male noname) if gender=="male", r 
di e(r2_a)

/// EVERYONE
xi: reg puresilencing female male noname i.experiment1, r cluster(texterid)
di e(r2_a)
//Study 1 only
xi: reg puresilencing female male noname if experiment1 == 1, r cluster(texterid)
di e(r2_a)
//Study 2 only
xi: reg puresilencing female male noname if experiment1 == 0, r cluster(texterid)
di e(r2_a)

/// RESPONDED
xi: reg puresilencing female male noname i.experiment1 if responded == 100, r 
di e(r2_a)
//Study 1 only
xi: reg puresilencing female male noname if experiment1 == 1 & responded == 100, r 
di e(r2_a)
//Study 2 only
xi: reg puresilencing female male noname if experiment1 == 0 & responded == 100, r 
di e(r2_a)
///subset to women only
xi: reg puresilencing female male noname i.experiment1 if gender=="female" & responded == 100, r 
di e(r2_a)
///subset to men only
xi: reg puresilencing female male noname i.experiment1 if gender=="male" & responded == 100, r
di e(r2_a)

/// EVERYONE WITH LOGITS
xi: logit puresilencing female male noname i.experiment1, r 
//Study 1 only
xi: logit puresilencing female male noname if experiment1 == 1, r 
//Study 2 only
xi: logit puresilencing female male noname if experiment1 == 0, r 
///subset to women only
xi: logit puresilencing female male noname i.experiment1 if gender=="female", r
///subset to men only
xi: logit puresilencing female male noname i.experiment1 if gender=="male", r 




